package cst.a112gxl.TeacherPlatform112gxl.fragment;


import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.CardView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import cst.a112gxl.TeacherPlatform112gxl.R;
import cst.a112gxl.TeacherPlatform112gxl.activity.MeActivity;

public class MeFragment extends Fragment {

    private View view;
    private Context context;
    private CardView collect,focus;

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        context = getContext();
        view = inflater.inflate(R.layout.me_fragment,container,false);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        final Intent intent=new Intent(context, MeActivity.class);

        collect = (CardView)getActivity().findViewById(R.id.card2);
        focus = (CardView)getActivity().findViewById(R.id.card3);
        focus.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent.putExtra("mod","focus");
                context.startActivity(intent);
            }
        });
        collect.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent.putExtra("mod","collect");
                context.startActivity(intent);
            }
        });
    }





}
